import request from '@/utils/request'

// 创建农户土地信息
export function createManagement(data) {
  return request({
    url: '/farmer/management/create',
    method: 'post',
    data: data
  })
}

// 更新农户土地信息
export function updateManagement(data) {
  return request({
    url: '/farmer/management/update',
    method: 'put',
    data: data
  })
}

// 删除农户土地信息
export function deleteManagement(id) {
  return request({
    url: '/farmer/management/delete?id=' + id,
    method: 'delete'
  })
}
//根据土地编码获得农户土地信息
export function getManagementByLandCode(id) {
  return request({
    url: '/farmer/management/getFarmer?farmerId=' + id,
    method: 'get'
  })
}

// 获得农户土地信息
export function getManagement(id) {
  return request({
    url: '/farmer/management/get?id=' + id,
    method: 'get'
  })
}

// 获得农户土地信息分页
export function getManagementPage(query) {
  return request({
    url: '/farmer/management/page',
    method: 'get',
    params: query
  })
}

// 导出农户土地信息 Excel
export function exportManagementExcel(query) {
  return request({
    url: '/farmer/management/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
